import 'package:flutter/material.dart';
import 'package:flutter_html/flutter_html.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:yp/config/config.dart';

import 'logic.dart';
import 'state.dart';

class AgreementPage extends StatelessWidget {
  final AgreementLogic logic = Get.put(AgreementLogic());
  final AgreementState state = Get.find<AgreementLogic>().state;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Config.mainColor,
        title: Text(
          state.type == 1 ? " 注册协议" : "隐私协议",
          style: TextStyle(
            color: Colors.white,
            fontSize: 34.sp,
          ),
        ),
        centerTitle: true,
        elevation: 0,
      ),
      body: GetBuilder<AgreementLogic>(
        builder: (logic) {
          return SingleChildScrollView(child: Html(data: state.content));
        },
      ),
    );
  }
}
